//父构造函数
function Animal(name){
    this.name = name;
    this.colors = ['pink','blue']
    this.sayName = function(){
        console.log(this.name,'-----------');
    }
}

// 构造函数（属性和方法） + 原型

//子构造函数
function Dog(name){
    //经典继承
    Animal.call(this,name)
    this.color = 'gray'
}

var dog = new Dog('haba')

console.log(dog)    //color----name colors sayName

dog.sayName()

